//
//  ZBOneSendCell.m
//  BaseRACDemo
//
//  Created by 庄波 on 2018/3/28.
//  Copyright © 2018年 庄波. All rights reserved.
//

#import "ZBOneSendCell.h"
#import "ZBOneSendCellModel.h"

@interface ZBOneSendCell()
@property (nonatomic,strong) ZBOneSendCellModel *viewModel;
@end

@implementation ZBOneSendCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *ID = @"sendCell";
    ZBOneSendCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) cell = [self mh_viewFromXib];
    return cell;
}

- (void)bindViewModel:(ZBOneSendCellModel *)viewModel{
    self.viewModel = viewModel;
}


- (void)setIndexPath:(NSIndexPath *)indexPath rowsInSection:(NSInteger)rows{};

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    //数据绑定
    RAC(self.textPhone,text) = RACObserve(self, viewModel.phone);
    [RACObserve(self, viewModel.isSeleled) subscribeNext:^(id  _Nullable x) {
        [self.btnSelected setSelected:self.viewModel.isSeleled];
    }];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
